// 导入 Vue 和 Vue Router
import { createRouter, createWebHistory } from 'vue-router';
import Index from '../views/Index.vue';
import BusinessList from '../views/BusinessList.vue';
import BusinessInfo from '../views/BusinessInfo.vue';
import Login from '../views/Login.vue';
import Orders from '../views/Orders.vue';
import UserAddress from '../views/UserAddress.vue';
import Payment from '../views/Payment.vue';
import OrderList from '../views/OrderList.vue';
import AddUserAddress from '../views/AddUserAddress.vue';
import EditUserAddress from '../views/EditUserAddress.vue';
import Register from '../views/Register.vue';
import MyInfo from '../views/MyInfo.vue';
import ChangePwd from '../views/ChangePwd.vue';
import Remark from '../views/Remark.vue';
import GameSnake from '../views/GameSnake.vue';
import BusinessControl from '../views/BusinessControl.vue';
import FoodChange from '../views/FoodChange.vue';
import FoodCreate from '../views/FoodCreate.vue';
import ChangeInfo from '../views/ChangeInfo.vue';
import MyWallet from '../views/MyWallet.vue';
import WalletRecharge from '../views/WalletRecharge.vue';
import WalletWithdraw from '../views/WalletWithdraw.vue';
import WalletTransaction from '../views/WalletTransaction.vue';
import WalletRepay from '../views/WalletRepay.vue';
import WalletLoan from '../views/WalletLoan.vue';
import RechargePayment from '../views/RechargePayment.vue';
import LoanPayment from '../views/LoanPayment.vue';
import OrderDetail from '../views/OrderDetail.vue';
import PointsStore from '../views/PointsStore.vue';
import Coupons from '../views/Coupons.vue';
import LevelInfo from '../views/LevelInfo.vue';
import SuperMember from '../views/SuperMember.vue';
import SuperMemberPayment from '../views/SuperMemberPayment.vue';
import MyFavorites from '../views/MyFavorites.vue';

// 定义路由
const routes = [
  { path: '/', name: 'Home', component: Index },
  { path: '/index', name: 'Index', component: Index },
  { path: '/businessList', name: 'BusinessList', component: BusinessList },
  { path: '/businessInfo', name: 'BusinessInfo', component: BusinessInfo },
  { path: '/login', name: 'Login', component: Login },
  { path: '/orders', name: 'Orders', component: Orders },
  { path: '/userAddress', name: 'UserAddress', component: UserAddress },
  { path: '/payment', name: 'Payment', component: Payment },
  { path: '/orderList', name: 'OrderList', component: OrderList },
  { path: '/orderDetail/:orderId', name: 'OrderDetail', component: OrderDetail },
  { path: '/addUserAddress', name: 'AddUserAddress', component: AddUserAddress },
  { path: '/editUserAddress', name: 'EditUserAddress', component: EditUserAddress },
  { path: '/register', name: 'Register', component: Register },
  { path: '/myInfo', name: 'MyInfo', component: MyInfo },
  { path: '/changePwd', name: 'ChangePwd', component: ChangePwd },
  { path: '/remark', name: 'Remark', component: Remark },
  { path: '/gameSnake', name: 'GameSnake', component: GameSnake },
  { path: '/businessControl', name: 'BusinessControl', component: BusinessControl },
  { path: '/foodChange', name: 'FoodChange', component: FoodChange },
  { path: '/foodCreate', name: 'FoodCreate', component: FoodCreate },
  { path: '/changeInfo', name: 'ChangeInfo', component: ChangeInfo },
  { path: '/myWallet', name: 'MyWallet', component: MyWallet },
  { path: '/walletRecharge', name: 'WalletRecharge', component: WalletRecharge },
  { path: '/walletWithdraw', name: 'WalletWithdraw', component: WalletWithdraw },
  { path: '/walletTransaction', name: 'WalletTransaction', component: WalletTransaction },
  { path: '/walletRepay', name: 'WalletRepay', component: WalletRepay },
  { path: '/walletLoan', name: 'WalletLoan', component: WalletLoan },
  { path: '/rechargePayment', name: 'RechargePayment', component: RechargePayment },
  { path: '/loanPayment', name: 'LoanPayment', component: LoanPayment },
  { path: '/pointsStore', name: 'PointsStore', component: PointsStore },
  { path: '/coupons', name: 'Coupons', component: Coupons },
  { path: '/levelInfo', name: 'LevelInfo', component: LevelInfo },
  { path: '/superMember', name: 'SuperMember', component: SuperMember },
  { path: '/superMemberPayment', name: 'SuperMemberPayment', component: SuperMemberPayment },
  { path: '/myFavorites', name: 'MyFavorites', component: MyFavorites },
];

// 创建路由实例
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

// 导出路由实例
export default router;
